﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
public partial class Main_Inventory_PurchaseReceived_PurchaseReceivedInternational : System.Web.UI.Page
{
    Datautility DU = new Datautility();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindPurchaseDetailsDisplay();
        }
    }
    private void bindPurchaseDetailsDisplay()
    {
        DataTable dtview = DU.getdatausingprocedure("usp_IVR_GetPurchaseReceivedInternational");
        if (dtview.Rows.Count > 0)
        {
            GrdpurView.DataSource = dtview;
            GrdpurView.DataBind();
        }
    }
    protected void GrdpurView_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            string poid = GrdpurView.DataKeys[e.Row.RowIndex].Values[0].ToString();
            string transferedid = GrdpurView.DataKeys[e.Row.RowIndex].Values[1].ToString();
            string trnid = GrdpurView.DataKeys[e.Row.RowIndex].Values[2].ToString();
            ((LinkButton)e.Row.Cells[9].Controls[1]).Attributes.Add("onclick", "open_Purchase_Recive_Details('" + poid + "','" + transferedid + "','" + trnid + "')");
        }
    }
    protected void GrdpurView_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType != DataControlRowType.Pager)
        {
            if (e.Row.RowState == DataControlRowState.Alternate)
            {
                e.Row.Attributes.Add("onmouseover", "this.className='rowhover'");
                e.Row.Attributes.Add("onmouseout", "this.className='gridview_alternate'");
                //e.Row.Attributes.Add("onclick", "this.className='rowselected'");
            }
            else if (e.Row.RowState == DataControlRowState.Normal)
            {
                e.Row.Attributes.Add("onmouseover", "this.className='rowhover'");
                e.Row.Attributes.Add("onmouseout", "this.className='gridviewitem'");
                //e.Row.Attributes.Add("onclick", "this.className='rowselected'");
            }
        }
    }
    protected void GrdpurView_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        GrdpurView.PageIndex = e.NewPageIndex;
        bindPurchaseDetailsDisplay();
    }

}